﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SynoManager.GUI;

namespace SynoManager.DownloadStation
{
    public partial class AdvancedPreferencesPanel : PreferencesPanel
    {
        private readonly DownloadStationService service;

        public AdvancedPreferencesPanel()
        {
            InitializeComponent();
        }

        public AdvancedPreferencesPanel(DownloadStationService service)
            :this()
        {
            this.service = service;
            backgroundTaskIntervalNumericUpDown.Value = service.BackgroundTaskInterval;
        }

        /// <summary>
        /// Save/Persist the settings on the <see cref="PreferencesPanel"/>.
        /// </summary>
        public override void Save()
        {
            service.BackgroundTaskInterval = (int)backgroundTaskIntervalNumericUpDown.Value;
        }
    }
}
